"use strict";
cc._RF.push(module, 'e6131Q15QlAeIpMngw1DUxP', 'small_map_node');
// scripts/small_map_node.js

"use strict";

var e = require;
var t = module;
var o = exports;

var _ii,
    nn = void 0 && (void 0).__extends || (_ii = function ii(t, e) {
  return (_ii = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _ii(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    rr = void 0 && (void 0).__awaiter || function (t, e, o, i) {
  return new (o || (o = Promise))(function (n, a) {
    function r(t) {
      try {
        l(i.next(t));
      } catch (e) {
        a(e);
      }
    }

    function s(t) {
      try {
        l(i["throw"](t));
      } catch (e) {
        a(e);
      }
    }

    function l(t) {
      var e;
      t.done ? n(t.value) : (e = t.value, e instanceof o ? e : new o(function (t) {
        t(e);
      })).then(r, s);
    }

    l((i = i.apply(t, e || [])).next());
  });
};

var oo = void 0 && (void 0).__decorate || function (e, t, a, n) {
  var i,
      o = arguments.length,
      s = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, a) : n;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n);else for (var r = e.length - 1; r >= 0; r--) {
    (i = e[r]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, a, s) : i(t, a)) || s);
  }
  return o > 3 && s && Object.defineProperty(t, a, s), s;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});

var a = e("BaseModuleUI"),
    n = e("NotifyEventType"),
    i = e("GlobalParams"),
    r = e("Game"),
    s = e("small_role_item"),
    l = cc._decorator,
    _ = l.ccclass,
    c = l.property,
    d = function (e) {
  function t() {
    var t = null !== e && e.apply(this, arguments) || this;
    return t.monster_time_list = [], t.left_tower_list = null, t.right_tower_list = null, t.role_head_view = null, t;
  }

  return nn(t, e), t.prototype.initView = function () {
    this.showSmallMap();
  }, t.prototype.addEvent = function () {
    this.attachEvent(n["default"].SEND_CREATE_MONSTER_INDEX, this.showMonsterInfo, this), this.attachEvent(n["default"].SEND_ROLE_BE_KILL_INFO, this.showTowerInfo, this);
  }, t.prototype.showSmallMap = function () {
    for (var e = 0; e < this.role_head_view.childrenCount; e++) {
      this.role_head_view.children[e].getComponent(s["default"]).showHeadInfo(e);
    }
  }, t.prototype.showMonsterInfo = function (e, t) {
    var o = t;
    this.monster_time_list[o].node.parent.children[0].color = new cc.Color(255, 255, 255), this.monster_time_list[o].node.active = !1, 5 != o && 6 != o || (this.monster_time_list[5].node.parent.active = 5 == o, this.monster_time_list[6].node.parent.active = 6 == o);
  }, t.prototype.showMonsterTime = function (e, t) {
    this.monster_time_list[e].node.active || (this.monster_time_list[e].node.active = !0, this.monster_time_list[e].node.parent.children[0].color = new cc.Color(65, 65, 65)), this.monster_time_list[e].string = (t / 10).toFixed();
  }, t.prototype.showTowerInfo = function (e, t) {
    if (t.be_kill == r.KillType.tower) for (var o = 0; o < this.left_tower_list.childrenCount; o++) {
      var a = o % 2,
          n = Math.floor(o / 2);
      t.team == r.TeamInfo.left_team ? this.left_tower_list.children[o].color = a < i.GlobalParams.GameDestroyTower[0][n] ? new cc.Color(65, 65, 65) : new cc.Color(255, 255, 255) : this.right_tower_list.children[o].color = a < i.GlobalParams.GameDestroyTower[1][n] ? new cc.Color(65, 65, 65) : new cc.Color(255, 255, 255);
    }
  }, oo([c(cc.Label)], t.prototype, "monster_time_list", void 0), oo([c(cc.Node)], t.prototype, "left_tower_list", void 0), oo([c(cc.Node)], t.prototype, "right_tower_list", void 0), oo([c(cc.Node)], t.prototype, "role_head_view", void 0), oo([_], t);
}(a["default"]);

o["default"] = d;

cc._RF.pop();